<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script src="./jquery.js"></script>
    <button>点击发送jsonp请求</button>
    <p></p>
    <script>
        /* function fn() {  //jq可以省略这一步
        } */
        $('button').click(function() {
            //jq发送jsonp要加一个 ?callback=? 参数   固定写法
            $.getJSON('http://localhost:3000/jsonp?callback=?',function(data) {
                console.log(data);
                $('p').html(data.a + '   '+ data.b);
            })
        })
    </script>
</body>
</html>